package com.zbs.framework.swagger.utils;

public class ApiTypeUtil {
    public static String getRequestType(String str) {
        switch (str) {
            case "FORM_DATA":
                return "multipart/form-data";
            case "JSON":
                return "application/json";
            case "RESTFUL":
                return "restful";
            default:
                return "";
        }
    }

    public static String getDataType(String str) {
        switch (str) {
            case "java.lang.String":
                return "string";
            case "java.lang.Integer":
            case "java.lang.Long":
            case "int":
            case "long":
                return "number";
            case "java.lang.Double":
            case "double":
            case "short":
            case "java.lang.Short":
            case "java.math.BigDecimal":
                return "double";
            case "boolean":
            case "java.lang.Boolean":
                return "boolean";
            case "char":
            case "java.lang.Character":
                return "char";
            case "java.util.Map":
                return "map";
            case "org.springframework.web.multipart.MultipartFile":
            case "java.io.File":
                return "file";
            case "java.util.Date":
            case "java.time.LocalDateTime":
                return "datetime";
            default:
                return "object";
        }
    }
}
